package com.ecube.maintenance.pojos;

import com.ecube.maintenance.biz.commons.IListItem;

import java.util.List;

/**
 * Created by Trible Chen on 2014/9/3.
 */
public class CityListInfo implements IListItem<CityListInfo.CityInfo> {

    String key;//列表所属分类。例如，热门，A,B
    List<CityInfo> data; //列表数据

    @Override
    public boolean isSection() {
        return true;
    }

    @Override
    public String getSectionName() {
        return key;
    }

    @Override
    public CityInfo getInfo() {
        return null;
    }

    public static class CityInfo implements IListItem<CityInfo> {
        String name;//城市名字
        double lon;//经度
        double lat;//纬度

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public double getLon() {
            return lon;
        }

        public void setLon(double lon) {
            this.lon = lon;
        }

        public double getLat() {
            return lat;
        }

        public void setLat(double lat) {
            this.lat = lat;
        }

        @Override
        public boolean isSection() {
            return false;
        }

        @Override
        public String getSectionName() {
            return null;
        }

        @Override
        public CityInfo getInfo() {
            return this;
        }
    }

    //a class used for adapter

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public List<CityInfo> getData() {
        return data;
    }

    public void setData(List<CityInfo> data) {
        this.data = data;
    }
}
